<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class table_export_model extends CI_Model
{
	
	public function __construct()
	{
		parent::__construct();
		

	} 

public function excel($table)
{
$this->db->select('product.name as Name,product.code as Code,category.name AS Category,company.name AS Company,product.purchase_price as PurchasePrice,product.selling_price as SellingPrice,product.opening_stock as OpeningStock,unit.name as Unit');
$this->db->from('product', 'category','company','unit' );
$this->db->join('category', 'product.id_category = category.id' );
$this->db->join('company', 'product.id_company = company.id');
$this->db->join('unit', 'product.id_unit =unit.id');
$query = $this->db->get();
return $query;


}
	
	
	
}
?>	